﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dia2Lib;

namespace Kokomo.Mirror.PeFormat.Symbols
{
	public class CompilandSymbol : Symbol
	{
		internal CompilandSymbol(
			IDiaSymbol symbol
			)
			: base(symbol)
		{
		}

		/* DispID 23 */
		public bool IsEditAndContinueEnabled { get { return this.DiaSymbol.editAndContinueEnabled != 0; } }
		/* DispID 3 */
		public Symbol LexicalParent { get { return FromDiaSymbol(this.DiaSymbol.lexicalParent, this.Source); } }
		/* DispID 64 */
		public uint LexicalParentId { get { return this.DiaSymbol.lexicalParentId; } }
		/* DispID 20 */
		public string LibraryName { get { return this.DiaSymbol.libraryName; } }
		/* DispID 30 */
		public string SourceFileName { get { return this.DiaSymbol.sourceFileName; } }

		public SourceFileBase SourceFile
		{
			get
			{
				string sourceFileName = this.SourceFileName;
				if (sourceFileName == null) return null;
				return this.Source.GetInjectedSourceFile(sourceFileName);
			}
		}
	}
}
